<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-comment">-- (c) The University of Glasgow 2002-2006</span><span>
</span><span id="line-2"></span><span>
</span><span id="line-3"></span><span class="hs-pragma">{-# LANGUAGE CPP, RankNTypes, BangPatterns #-}</span><span>
</span><span id="line-4"></span><span>
</span><span id="line-5"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.Iface.Env</span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-6"></span><span>        </span><span class="annot"><a href="GHC.Iface.Env.html#newGlobalBinder"><span class="hs-identifier">newGlobalBinder</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Iface.Env.html#newInteractiveBinder"><span class="hs-identifier">newInteractiveBinder</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-7"></span><span>        </span><span class="annot"><a href="GHC.Iface.Env.html#externaliseName"><span class="hs-identifier">externaliseName</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-8"></span><span>        </span><span class="annot"><a href="GHC.Iface.Env.html#lookupIfaceTop"><span class="hs-identifier">lookupIfaceTop</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-9"></span><span>        </span><span class="annot"><a href="GHC.Iface.Env.html#lookupOrig"><span class="hs-identifier">lookupOrig</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Iface.Env.html#lookupOrigIO"><span class="hs-identifier">lookupOrigIO</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.Cache.html#lookupOrigNameCache"><span class="hs-identifier">lookupOrigNameCache</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.Cache.html#extendNameCache"><span class="hs-identifier">extendNameCache</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-10"></span><span>        </span><span class="annot"><a href="GHC.Iface.Env.html#newIfaceName"><span class="hs-identifier">newIfaceName</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Iface.Env.html#newIfaceNames"><span class="hs-identifier">newIfaceNames</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-11"></span><span>        </span><span class="annot"><a href="GHC.Iface.Env.html#extendIfaceIdEnv"><span class="hs-identifier">extendIfaceIdEnv</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Iface.Env.html#extendIfaceTyVarEnv"><span class="hs-identifier">extendIfaceTyVarEnv</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-12"></span><span>        </span><span class="annot"><a href="GHC.Iface.Env.html#tcIfaceLclId"><span class="hs-identifier">tcIfaceLclId</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Iface.Env.html#tcIfaceTyVar"><span class="hs-identifier">tcIfaceTyVar</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Iface.Env.html#lookupIfaceVar"><span class="hs-identifier">lookupIfaceVar</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-13"></span><span>        </span><span class="annot"><a href="GHC.Iface.Env.html#lookupIfaceTyVar"><span class="hs-identifier">lookupIfaceTyVar</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Iface.Env.html#extendIfaceEnvs"><span class="hs-identifier">extendIfaceEnvs</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-14"></span><span>        </span><span class="annot"><a href="GHC.Iface.Env.html#setNameModule"><span class="hs-identifier">setNameModule</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-15"></span><span>
</span><span id="line-16"></span><span>        </span><span class="annot"><a href="GHC.Iface.Env.html#ifaceExportNames"><span class="hs-identifier">ifaceExportNames</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-17"></span><span>
</span><span id="line-18"></span><span>        </span><span class="hs-comment">-- Name-cache stuff</span><span>
</span><span id="line-19"></span><span>        </span><span class="annot"><a href="GHC.Iface.Env.html#allocateGlobalBinder"><span class="hs-identifier">allocateGlobalBinder</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Iface.Env.html#updNameCacheTc"><span class="hs-identifier">updNameCacheTc</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-20"></span><span>        </span><span class="annot"><a href="GHC.Iface.Env.html#mkNameCacheUpdater"><span class="hs-identifier">mkNameCacheUpdater</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Iface.Env.html#NameCacheUpdater"><span class="hs-identifier">NameCacheUpdater</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-21"></span><span>   </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span class="hs-cpp">

#include &quot;HsVersions.h&quot;
</span><span>
</span><span id="line-25"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Prelude.html"><span class="hs-identifier">GHC.Prelude</span></a></span><span>
</span><span id="line-26"></span><span>
</span><span id="line-27"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Monad.html"><span class="hs-identifier">GHC.Tc.Utils.Monad</span></a></span><span>
</span><span id="line-28"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html"><span class="hs-identifier">GHC.Driver.Types</span></a></span><span>
</span><span id="line-29"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Type.html"><span class="hs-identifier">GHC.Core.Type</span></a></span><span>
</span><span id="line-30"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Var.html"><span class="hs-identifier">GHC.Types.Var</span></a></span><span>
</span><span id="line-31"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Name.html"><span class="hs-identifier">GHC.Types.Name</span></a></span><span>
</span><span id="line-32"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Avail.html"><span class="hs-identifier">GHC.Types.Avail</span></a></span><span>
</span><span id="line-33"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Unit.Module.html"><span class="hs-identifier">GHC.Unit.Module</span></a></span><span>
</span><span id="line-34"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html"><span class="hs-identifier">GHC.Data.FastString</span></a></span><span>
</span><span id="line-35"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.FastString.Env.html"><span class="hs-identifier">GHC.Data.FastString.Env</span></a></span><span>
</span><span id="line-36"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Iface.Type.html"><span class="hs-identifier">GHC.Iface.Type</span></a></span><span>
</span><span id="line-37"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Name.Cache.html"><span class="hs-identifier">GHC.Types.Name.Cache</span></a></span><span>
</span><span id="line-38"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html"><span class="hs-identifier">GHC.Types.Unique.Supply</span></a></span><span>
</span><span id="line-39"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html"><span class="hs-identifier">GHC.Types.SrcLoc</span></a></span><span>
</span><span id="line-40"></span><span>
</span><span id="line-41"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html"><span class="hs-identifier">GHC.Utils.Outputable</span></a></span><span>
</span><span id="line-42"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.List.html#"><span class="hs-identifier">Data.List</span></a></span><span>     </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/Data.OldList.html#partition"><span class="hs-identifier">partition</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-43"></span><span>
</span><span id="line-44"></span><span class="hs-comment">{-
*********************************************************
*                                                      *
        Allocating new Names in the Name Cache
*                                                      *
*********************************************************

See Also: Note [The Name Cache] in GHC.Types.Name.Cache
-}</span><span>
</span><span id="line-53"></span><span>
</span><span id="line-54"></span><span id="local-6989586621681088941"><span id="local-6989586621681088942"><span class="annot"><a href="GHC.Iface.Env.html#newGlobalBinder"><span class="hs-identifier hs-type">newGlobalBinder</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#Module"><span class="hs-identifier hs-type">Module</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.Occurrence.html#OccName"><span class="hs-identifier hs-type">OccName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#SrcSpan"><span class="hs-identifier hs-type">SrcSpan</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcRnIf"><span class="hs-identifier hs-type">TcRnIf</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681088942"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681088941"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span></span></span><span>
</span><span id="line-55"></span><span class="hs-comment">-- Used for source code and interface files, to make the</span><span>
</span><span id="line-56"></span><span class="hs-comment">-- Name for a thing, given its Module and OccName</span><span>
</span><span id="line-57"></span><span class="hs-comment">-- See Note [The Name Cache] in GHC.Types.Name.Cache</span><span>
</span><span id="line-58"></span><span class="hs-comment">--</span><span>
</span><span id="line-59"></span><span class="hs-comment">-- The cache may already have a binding for this thing,</span><span>
</span><span id="line-60"></span><span class="hs-comment">-- because we may have seen an occurrence before, but now is the</span><span>
</span><span id="line-61"></span><span class="hs-comment">-- moment when we know its Module and SrcLoc in their full glory</span><span>
</span><span id="line-62"></span><span>
</span><span id="line-63"></span><span id="newGlobalBinder"><span class="annot"><span class="annottext">newGlobalBinder :: forall a b. Module -&gt; OccName -&gt; SrcSpan -&gt; TcRnIf a b Name
</span><a href="GHC.Iface.Env.html#newGlobalBinder"><span class="hs-identifier hs-var hs-var">newGlobalBinder</span></a></span></span><span> </span><span id="local-6989586621681088796"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681088796"><span class="hs-identifier hs-var">mod</span></a></span></span><span> </span><span id="local-6989586621681088795"><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681088795"><span class="hs-identifier hs-var">occ</span></a></span></span><span> </span><span id="local-6989586621681088794"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681088794"><span class="hs-identifier hs-var">loc</span></a></span></span><span>
</span><span id="line-64"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681088793"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681088793"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Module
-&gt; OccName -&gt; (NameCache -&gt; (NameCache, Name)) -&gt; TcRnIf a b Name
forall c a b.
Module -&gt; OccName -&gt; (NameCache -&gt; (NameCache, c)) -&gt; TcRnIf a b c
</span><a href="GHC.Iface.Env.html#updNameCacheTc"><span class="hs-identifier hs-var">updNameCacheTc</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681088796"><span class="hs-identifier hs-var">mod</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681088795"><span class="hs-identifier hs-var">occ</span></a></span><span> </span><span class="annot"><span class="annottext">((NameCache -&gt; (NameCache, Name)) -&gt; TcRnIf a b Name)
-&gt; (NameCache -&gt; (NameCache, Name)) -&gt; TcRnIf a b Name
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681088792"><span class="annot"><span class="annottext">NameCache
</span><a href="#local-6989586621681088792"><span class="hs-identifier hs-var">name_cache</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-65"></span><span>                 </span><span class="annot"><span class="annottext">NameCache -&gt; Module -&gt; OccName -&gt; SrcSpan -&gt; (NameCache, Name)
</span><a href="GHC.Iface.Env.html#allocateGlobalBinder"><span class="hs-identifier hs-var">allocateGlobalBinder</span></a></span><span> </span><span class="annot"><span class="annottext">NameCache
</span><a href="#local-6989586621681088792"><span class="hs-identifier hs-var">name_cache</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681088796"><span class="hs-identifier hs-var">mod</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681088795"><span class="hs-identifier hs-var">occ</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681088794"><span class="hs-identifier hs-var">loc</span></a></span><span>
</span><span id="line-66"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; TcRnIf a b ()
forall m n. SDoc -&gt; TcRnIf m n ()
</span><a href="GHC.Tc.Utils.Monad.html#traceIf"><span class="hs-identifier hs-var">traceIf</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;newGlobalBinder&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span>
</span><span id="line-67"></span><span>                  </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">Module -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681088796"><span class="hs-identifier hs-var">mod</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">OccName -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681088795"><span class="hs-identifier hs-var">occ</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681088794"><span class="hs-identifier hs-var">loc</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Name -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681088793"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-68"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Name -&gt; TcRnIf a b Name
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681088793"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-69"></span><span>
</span><span id="line-70"></span><span class="annot"><a href="GHC.Iface.Env.html#newInteractiveBinder"><span class="hs-identifier hs-type">newInteractiveBinder</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#HscEnv"><span class="hs-identifier hs-type">HscEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.Occurrence.html#OccName"><span class="hs-identifier hs-type">OccName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#SrcSpan"><span class="hs-identifier hs-type">SrcSpan</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span>
</span><span id="line-71"></span><span class="hs-comment">-- Works in the IO monad, and gets the Module</span><span>
</span><span id="line-72"></span><span class="hs-comment">-- from the interactive context</span><span>
</span><span id="line-73"></span><span id="newInteractiveBinder"><span class="annot"><span class="annottext">newInteractiveBinder :: HscEnv -&gt; OccName -&gt; SrcSpan -&gt; IO Name
</span><a href="GHC.Iface.Env.html#newInteractiveBinder"><span class="hs-identifier hs-var hs-var">newInteractiveBinder</span></a></span></span><span> </span><span id="local-6989586621681088786"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681088786"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span id="local-6989586621681088785"><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681088785"><span class="hs-identifier hs-var">occ</span></a></span></span><span> </span><span id="local-6989586621681088784"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681088784"><span class="hs-identifier hs-var">loc</span></a></span></span><span>
</span><span id="line-74"></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681088783"><span class="annot"><span class="annottext">mod :: Module
</span><a href="#local-6989586621681088783"><span class="hs-identifier hs-var hs-var">mod</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">InteractiveContext -&gt; Module
</span><a href="GHC.Driver.Types.html#icInteractiveModule"><span class="hs-identifier hs-var">icInteractiveModule</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv -&gt; InteractiveContext
</span><a href="GHC.Driver.Types.html#hsc_IC"><span class="hs-identifier hs-var hs-var">hsc_IC</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681088786"><span class="hs-identifier hs-var">hsc_env</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-75"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">HscEnv
-&gt; Module -&gt; OccName -&gt; (NameCache -&gt; (NameCache, Name)) -&gt; IO Name
forall c.
HscEnv
-&gt; Module -&gt; OccName -&gt; (NameCache -&gt; (NameCache, c)) -&gt; IO c
</span><a href="GHC.Iface.Env.html#updNameCacheIO"><span class="hs-identifier hs-var">updNameCacheIO</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681088786"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681088783"><span class="hs-identifier hs-var">mod</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681088785"><span class="hs-identifier hs-var">occ</span></a></span><span> </span><span class="annot"><span class="annottext">((NameCache -&gt; (NameCache, Name)) -&gt; IO Name)
-&gt; (NameCache -&gt; (NameCache, Name)) -&gt; IO Name
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681088779"><span class="annot"><span class="annottext">NameCache
</span><a href="#local-6989586621681088779"><span class="hs-identifier hs-var">name_cache</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-76"></span><span>         </span><span class="annot"><span class="annottext">NameCache -&gt; Module -&gt; OccName -&gt; SrcSpan -&gt; (NameCache, Name)
</span><a href="GHC.Iface.Env.html#allocateGlobalBinder"><span class="hs-identifier hs-var">allocateGlobalBinder</span></a></span><span> </span><span class="annot"><span class="annottext">NameCache
</span><a href="#local-6989586621681088779"><span class="hs-identifier hs-var">name_cache</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681088783"><span class="hs-identifier hs-var">mod</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681088785"><span class="hs-identifier hs-var">occ</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681088784"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-77"></span><span>
</span><span id="line-78"></span><span class="annot"><a href="GHC.Iface.Env.html#allocateGlobalBinder"><span class="hs-identifier hs-type">allocateGlobalBinder</span></a></span><span>
</span><span id="line-79"></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.Cache.html#NameCache"><span class="hs-identifier hs-type">NameCache</span></a></span><span>
</span><span id="line-80"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#Module"><span class="hs-identifier hs-type">Module</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.Occurrence.html#OccName"><span class="hs-identifier hs-type">OccName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#SrcSpan"><span class="hs-identifier hs-type">SrcSpan</span></a></span><span>
</span><span id="line-81"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Name.Cache.html#NameCache"><span class="hs-identifier hs-type">NameCache</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-82"></span><span class="hs-comment">-- See Note [The Name Cache] in GHC.Types.Name.Cache</span><span>
</span><span id="line-83"></span><span id="allocateGlobalBinder"><span class="annot"><span class="annottext">allocateGlobalBinder :: NameCache -&gt; Module -&gt; OccName -&gt; SrcSpan -&gt; (NameCache, Name)
</span><a href="GHC.Iface.Env.html#allocateGlobalBinder"><span class="hs-identifier hs-var hs-var">allocateGlobalBinder</span></a></span></span><span> </span><span id="local-6989586621681088778"><span class="annot"><span class="annottext">NameCache
</span><a href="#local-6989586621681088778"><span class="hs-identifier hs-var">name_supply</span></a></span></span><span> </span><span id="local-6989586621681088777"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681088777"><span class="hs-identifier hs-var">mod</span></a></span></span><span> </span><span id="local-6989586621681088776"><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681088776"><span class="hs-identifier hs-var">occ</span></a></span></span><span> </span><span id="local-6989586621681088775"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681088775"><span class="hs-identifier hs-var">loc</span></a></span></span><span>
</span><span id="line-84"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">OrigNameCache -&gt; Module -&gt; OccName -&gt; Maybe Name
</span><a href="GHC.Types.Name.Cache.html#lookupOrigNameCache"><span class="hs-identifier hs-var">lookupOrigNameCache</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">NameCache -&gt; OrigNameCache
</span><a href="GHC.Types.Name.Cache.html#nsNames"><span class="hs-identifier hs-var hs-var">nsNames</span></a></span><span> </span><span class="annot"><span class="annottext">NameCache
</span><a href="#local-6989586621681088778"><span class="hs-identifier hs-var">name_supply</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681088777"><span class="hs-identifier hs-var">mod</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681088776"><span class="hs-identifier hs-var">occ</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-85"></span><span>        </span><span class="hs-comment">-- A hit in the cache!  We are at the binding site of the name.</span><span>
</span><span id="line-86"></span><span>        </span><span class="hs-comment">-- This is the moment when we know the SrcLoc</span><span>
</span><span id="line-87"></span><span>        </span><span class="hs-comment">-- of the Name, so we set this field in the Name we return.</span><span>
</span><span id="line-88"></span><span>        </span><span class="hs-comment">--</span><span>
</span><span id="line-89"></span><span>        </span><span class="hs-comment">-- Then (bogus) multiple bindings of the same Name</span><span>
</span><span id="line-90"></span><span>        </span><span class="hs-comment">-- get different SrcLocs can be reported as such.</span><span>
</span><span id="line-91"></span><span>        </span><span class="hs-comment">--</span><span>
</span><span id="line-92"></span><span>        </span><span class="hs-comment">-- Possible other reason: it might be in the cache because we</span><span>
</span><span id="line-93"></span><span>        </span><span class="hs-comment">--      encountered an occurrence before the binding site for an</span><span>
</span><span id="line-94"></span><span>        </span><span class="hs-comment">--      implicitly-imported Name.  Perhaps the current SrcLoc is</span><span>
</span><span id="line-95"></span><span>        </span><span class="hs-comment">--      better... but not really: it'll still just say 'imported'</span><span>
</span><span id="line-96"></span><span>        </span><span class="hs-comment">--</span><span>
</span><span id="line-97"></span><span>        </span><span class="hs-comment">-- IMPORTANT: Don't mess with wired-in names.</span><span>
</span><span id="line-98"></span><span>        </span><span class="hs-comment">--            Their wired-in-ness is in their NameSort</span><span>
</span><span id="line-99"></span><span>        </span><span class="hs-comment">--            and their Module is correct.</span><span>
</span><span id="line-100"></span><span>
</span><span id="line-101"></span><span>        </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681088773"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681088773"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Bool
</span><a href="GHC.Types.Name.html#isWiredInName"><span class="hs-identifier hs-var">isWiredInName</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681088773"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-102"></span><span>                  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">NameCache
</span><a href="#local-6989586621681088778"><span class="hs-identifier hs-var">name_supply</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681088773"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-103"></span><span>                  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-104"></span><span>                  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">NameCache
</span><a href="#local-6989586621681088771"><span class="hs-identifier hs-var">new_name_supply</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681088770"><span class="hs-identifier hs-var">name'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-105"></span><span>                  </span><span class="hs-keyword">where</span><span>
</span><span id="line-106"></span><span>                    </span><span id="local-6989586621681088769"><span class="annot"><span class="annottext">uniq :: Unique
</span><a href="#local-6989586621681088769"><span class="hs-identifier hs-var hs-var">uniq</span></a></span></span><span>            </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Unique
</span><a href="GHC.Types.Name.html#nameUnique"><span class="hs-identifier hs-var">nameUnique</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681088773"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-107"></span><span>                    </span><span id="local-6989586621681088770"><span class="annot"><span class="annottext">name' :: Name
</span><a href="#local-6989586621681088770"><span class="hs-identifier hs-var hs-var">name'</span></a></span></span><span>           </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Unique -&gt; Module -&gt; OccName -&gt; SrcSpan -&gt; Name
</span><a href="GHC.Types.Name.html#mkExternalName"><span class="hs-identifier hs-var">mkExternalName</span></a></span><span> </span><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621681088769"><span class="hs-identifier hs-var">uniq</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681088777"><span class="hs-identifier hs-var">mod</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681088776"><span class="hs-identifier hs-var">occ</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681088775"><span class="hs-identifier hs-var">loc</span></a></span><span>
</span><span id="line-108"></span><span>                                      </span><span class="hs-comment">-- name' is like name, but with the right SrcSpan</span><span>
</span><span id="line-109"></span><span>                    </span><span id="local-6989586621681088766"><span class="annot"><span class="annottext">new_cache :: OrigNameCache
</span><a href="#local-6989586621681088766"><span class="hs-identifier hs-var hs-var">new_cache</span></a></span></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">OrigNameCache -&gt; Module -&gt; OccName -&gt; Name -&gt; OrigNameCache
</span><a href="GHC.Types.Name.Cache.html#extendNameCache"><span class="hs-identifier hs-var">extendNameCache</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">NameCache -&gt; OrigNameCache
</span><a href="GHC.Types.Name.Cache.html#nsNames"><span class="hs-identifier hs-var hs-var">nsNames</span></a></span><span> </span><span class="annot"><span class="annottext">NameCache
</span><a href="#local-6989586621681088778"><span class="hs-identifier hs-var">name_supply</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681088777"><span class="hs-identifier hs-var">mod</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681088776"><span class="hs-identifier hs-var">occ</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681088770"><span class="hs-identifier hs-var">name'</span></a></span><span>
</span><span id="line-110"></span><span>                    </span><span id="local-6989586621681088771"><span class="annot"><span class="annottext">new_name_supply :: NameCache
</span><a href="#local-6989586621681088771"><span class="hs-identifier hs-var hs-var">new_name_supply</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">NameCache
</span><a href="#local-6989586621681088778"><span class="hs-identifier hs-var">name_supply</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">nsNames :: OrigNameCache
</span><a href="GHC.Types.Name.Cache.html#nsNames"><span class="hs-identifier hs-var">nsNames</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">OrigNameCache
</span><a href="#local-6989586621681088766"><span class="hs-identifier hs-var">new_cache</span></a></span><span class="hs-special">}</span><span>
</span><span id="line-111"></span><span>
</span><span id="line-112"></span><span>        </span><span class="hs-comment">-- Miss in the cache!</span><span>
</span><span id="line-113"></span><span>        </span><span class="hs-comment">-- Build a completely new Name, and put it in the cache</span><span>
</span><span id="line-114"></span><span>        </span><span class="annot"><span class="annottext">Maybe Name
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">NameCache
</span><a href="#local-6989586621681088765"><span class="hs-identifier hs-var">new_name_supply</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681088764"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-115"></span><span>                  </span><span class="hs-keyword">where</span><span>
</span><span id="line-116"></span><span>                    </span><span class="hs-special">(</span><span id="local-6989586621681088763"><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621681088763"><span class="hs-identifier hs-var">uniq</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681088762"><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681088762"><span class="hs-identifier hs-var">us'</span></a></span></span><span class="hs-special">)</span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UniqSupply -&gt; (Unique, UniqSupply)
</span><a href="GHC.Types.Unique.Supply.html#takeUniqFromSupply"><span class="hs-identifier hs-var">takeUniqFromSupply</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">NameCache -&gt; UniqSupply
</span><a href="GHC.Types.Name.Cache.html#nsUniqs"><span class="hs-identifier hs-var hs-var">nsUniqs</span></a></span><span> </span><span class="annot"><span class="annottext">NameCache
</span><a href="#local-6989586621681088778"><span class="hs-identifier hs-var">name_supply</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-117"></span><span>                    </span><span id="local-6989586621681088764"><span class="annot"><span class="annottext">name :: Name
</span><a href="#local-6989586621681088764"><span class="hs-identifier hs-var hs-var">name</span></a></span></span><span>            </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Unique -&gt; Module -&gt; OccName -&gt; SrcSpan -&gt; Name
</span><a href="GHC.Types.Name.html#mkExternalName"><span class="hs-identifier hs-var">mkExternalName</span></a></span><span> </span><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621681088763"><span class="hs-identifier hs-var">uniq</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681088777"><span class="hs-identifier hs-var">mod</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681088776"><span class="hs-identifier hs-var">occ</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681088775"><span class="hs-identifier hs-var">loc</span></a></span><span>
</span><span id="line-118"></span><span>                    </span><span id="local-6989586621681088759"><span class="annot"><span class="annottext">new_cache :: OrigNameCache
</span><a href="#local-6989586621681088759"><span class="hs-identifier hs-var hs-var">new_cache</span></a></span></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">OrigNameCache -&gt; Module -&gt; OccName -&gt; Name -&gt; OrigNameCache
</span><a href="GHC.Types.Name.Cache.html#extendNameCache"><span class="hs-identifier hs-var">extendNameCache</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">NameCache -&gt; OrigNameCache
</span><a href="GHC.Types.Name.Cache.html#nsNames"><span class="hs-identifier hs-var hs-var">nsNames</span></a></span><span> </span><span class="annot"><span class="annottext">NameCache
</span><a href="#local-6989586621681088778"><span class="hs-identifier hs-var">name_supply</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681088777"><span class="hs-identifier hs-var">mod</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681088776"><span class="hs-identifier hs-var">occ</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681088764"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-119"></span><span>                    </span><span id="local-6989586621681088765"><span class="annot"><span class="annottext">new_name_supply :: NameCache
</span><a href="#local-6989586621681088765"><span class="hs-identifier hs-var hs-var">new_name_supply</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">NameCache
</span><a href="#local-6989586621681088778"><span class="hs-identifier hs-var">name_supply</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">nsUniqs :: UniqSupply
</span><a href="GHC.Types.Name.Cache.html#nsUniqs"><span class="hs-identifier hs-var">nsUniqs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681088762"><span class="hs-identifier hs-var">us'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">nsNames :: OrigNameCache
</span><a href="GHC.Types.Name.Cache.html#nsNames"><span class="hs-identifier hs-var">nsNames</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">OrigNameCache
</span><a href="#local-6989586621681088759"><span class="hs-identifier hs-var">new_cache</span></a></span><span class="hs-special">}</span><span>
</span><span id="line-120"></span><span>
</span><span id="line-121"></span><span id="local-6989586621681088915"><span id="local-6989586621681088916"><span class="annot"><a href="GHC.Iface.Env.html#ifaceExportNames"><span class="hs-identifier hs-type">ifaceExportNames</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Driver.Types.html#IfaceExport"><span class="hs-identifier hs-type">IfaceExport</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcRnIf"><span class="hs-identifier hs-type">TcRnIf</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681088916"><span class="hs-identifier hs-type">gbl</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681088915"><span class="hs-identifier hs-type">lcl</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Avail.html#AvailInfo"><span class="hs-identifier hs-type">AvailInfo</span></a></span><span class="hs-special">]</span></span></span><span>
</span><span id="line-122"></span><span id="ifaceExportNames"><span class="annot"><span class="annottext">ifaceExportNames :: forall gbl lcl. [IfaceExport] -&gt; TcRnIf gbl lcl [IfaceExport]
</span><a href="GHC.Iface.Env.html#ifaceExportNames"><span class="hs-identifier hs-var hs-var">ifaceExportNames</span></a></span></span><span> </span><span id="local-6989586621681088756"><span class="annot"><span class="annottext">[IfaceExport]
</span><a href="#local-6989586621681088756"><span class="hs-identifier hs-var">exports</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[IfaceExport] -&gt; IOEnv (Env gbl lcl) [IfaceExport]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">[IfaceExport]
</span><a href="#local-6989586621681088756"><span class="hs-identifier hs-var">exports</span></a></span><span>
</span><span id="line-123"></span><span>
</span><span id="line-124"></span><span class="hs-comment">-- | A function that atomically updates the name cache given a modifier</span><span>
</span><span id="line-125"></span><span class="hs-comment">-- function.  The second result of the modifier function will be the result</span><span>
</span><span id="line-126"></span><span class="hs-comment">-- of the IO action.</span><span>
</span><span id="line-127"></span><span class="hs-keyword">newtype</span><span> </span><span id="NameCacheUpdater"><span class="annot"><a href="GHC.Iface.Env.html#NameCacheUpdater"><span class="hs-identifier hs-var">NameCacheUpdater</span></a></span></span><span>
</span><span id="line-128"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span id="NCU"><span class="annot"><a href="GHC.Iface.Env.html#NCU"><span class="hs-identifier hs-var">NCU</span></a></span></span><span> </span><span class="hs-special">{</span><span> </span><span id="updateNameCache"><span class="annot"><span class="annottext">NameCacheUpdater -&gt; forall c. (NameCache -&gt; (NameCache, c)) -&gt; IO c
</span><a href="GHC.Iface.Env.html#updateNameCache"><span class="hs-identifier hs-var hs-var">updateNameCache</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-keyword">forall</span><span> </span><span id="local-6989586621681088911"><span class="annot"><a href="#local-6989586621681088911"><span class="hs-identifier hs-type">c</span></a></span></span><span class="hs-operator">.</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Name.Cache.html#NameCache"><span class="hs-identifier hs-type">NameCache</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Name.Cache.html#NameCache"><span class="hs-identifier hs-type">NameCache</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621681088911"><span class="hs-identifier hs-type">c</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="#local-6989586621681088911"><span class="hs-identifier hs-type">c</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-129"></span><span>
</span><span id="line-130"></span><span id="local-6989586621681088908"><span id="local-6989586621681088909"><span class="annot"><a href="GHC.Iface.Env.html#mkNameCacheUpdater"><span class="hs-identifier hs-type">mkNameCacheUpdater</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcRnIf"><span class="hs-identifier hs-type">TcRnIf</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681088909"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681088908"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="annot"><a href="GHC.Iface.Env.html#NameCacheUpdater"><span class="hs-identifier hs-type">NameCacheUpdater</span></a></span></span></span><span>
</span><span id="line-131"></span><span id="mkNameCacheUpdater"><span class="annot"><span class="annottext">mkNameCacheUpdater :: forall a b. TcRnIf a b NameCacheUpdater
</span><a href="GHC.Iface.Env.html#mkNameCacheUpdater"><span class="hs-identifier hs-var hs-var">mkNameCacheUpdater</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681088751"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681088751"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcRnIf a b HscEnv
forall gbl lcl. TcRnIf gbl lcl HscEnv
</span><a href="GHC.Tc.Utils.Monad.html#getTopEnv"><span class="hs-identifier hs-var">getTopEnv</span></a></span><span>
</span><span id="line-132"></span><span>                        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621681088749"><span class="annot"><span class="annottext">ncRef :: IORef NameCache
</span><a href="#local-6989586621681088749"><span class="hs-identifier hs-var hs-var">ncRef</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; IORef NameCache
</span><a href="GHC.Driver.Types.html#hsc_NC"><span class="hs-identifier hs-var hs-var">hsc_NC</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681088751"><span class="hs-identifier hs-var">hsc_env</span></a></span><span>
</span><span id="line-133"></span><span>                        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">NameCacheUpdater -&gt; TcRnIf a b NameCacheUpdater
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(forall c. (NameCache -&gt; (NameCache, c)) -&gt; IO c)
-&gt; NameCacheUpdater
</span><a href="GHC.Iface.Env.html#NCU"><span class="hs-identifier hs-var">NCU</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IORef NameCache -&gt; (NameCache -&gt; (NameCache, c)) -&gt; IO c
forall c. IORef NameCache -&gt; (NameCache -&gt; (NameCache, c)) -&gt; IO c
</span><a href="GHC.Driver.Types.html#updNameCache"><span class="hs-identifier hs-var">updNameCache</span></a></span><span> </span><span class="annot"><span class="annottext">IORef NameCache
</span><a href="#local-6989586621681088749"><span class="hs-identifier hs-var">ncRef</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-134"></span><span>
</span><span id="line-135"></span><span id="local-6989586621681088933"><span id="local-6989586621681088934"><span id="local-6989586621681088935"><span class="annot"><a href="GHC.Iface.Env.html#updNameCacheTc"><span class="hs-identifier hs-type">updNameCacheTc</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#Module"><span class="hs-identifier hs-type">Module</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.Occurrence.html#OccName"><span class="hs-identifier hs-type">OccName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Name.Cache.html#NameCache"><span class="hs-identifier hs-type">NameCache</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Name.Cache.html#NameCache"><span class="hs-identifier hs-type">NameCache</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621681088935"><span class="hs-identifier hs-type">c</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-136"></span><span>               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcRnIf"><span class="hs-identifier hs-type">TcRnIf</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681088934"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681088933"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681088935"><span class="hs-identifier hs-type">c</span></a></span></span></span></span><span>
</span><span id="line-137"></span><span id="updNameCacheTc"><span class="annot"><span class="annottext">updNameCacheTc :: forall c a b.
Module -&gt; OccName -&gt; (NameCache -&gt; (NameCache, c)) -&gt; TcRnIf a b c
</span><a href="GHC.Iface.Env.html#updNameCacheTc"><span class="hs-identifier hs-var hs-var">updNameCacheTc</span></a></span></span><span> </span><span id="local-6989586621681088743"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681088743"><span class="hs-identifier hs-var">mod</span></a></span></span><span> </span><span id="local-6989586621681088742"><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681088742"><span class="hs-identifier hs-var">occ</span></a></span></span><span> </span><span id="local-6989586621681088741"><span class="annot"><span class="annottext">NameCache -&gt; (NameCache, c)
</span><a href="#local-6989586621681088741"><span class="hs-identifier hs-var">upd_fn</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-138"></span><span>    </span><span id="local-6989586621681088740"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681088740"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcRnIf a b HscEnv
forall gbl lcl. TcRnIf gbl lcl HscEnv
</span><a href="GHC.Tc.Utils.Monad.html#getTopEnv"><span class="hs-identifier hs-var">getTopEnv</span></a></span><span>
</span><span id="line-139"></span><span>  </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">IO c -&gt; TcRnIf a b c
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO c -&gt; TcRnIf a b c) -&gt; IO c -&gt; TcRnIf a b c
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
-&gt; Module -&gt; OccName -&gt; (NameCache -&gt; (NameCache, c)) -&gt; IO c
forall c.
HscEnv
-&gt; Module -&gt; OccName -&gt; (NameCache -&gt; (NameCache, c)) -&gt; IO c
</span><a href="GHC.Iface.Env.html#updNameCacheIO"><span class="hs-identifier hs-var">updNameCacheIO</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681088740"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681088743"><span class="hs-identifier hs-var">mod</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681088742"><span class="hs-identifier hs-var">occ</span></a></span><span> </span><span class="annot"><span class="annottext">NameCache -&gt; (NameCache, c)
</span><a href="#local-6989586621681088741"><span class="hs-identifier hs-var">upd_fn</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-140"></span><span>
</span><span id="line-141"></span><span>
</span><span id="line-142"></span><span id="local-6989586621681088921"><span class="annot"><a href="GHC.Iface.Env.html#updNameCacheIO"><span class="hs-identifier hs-type">updNameCacheIO</span></a></span><span> </span><span class="hs-glyph">::</span><span>  </span><span class="annot"><a href="GHC.Driver.Types.html#HscEnv"><span class="hs-identifier hs-type">HscEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#Module"><span class="hs-identifier hs-type">Module</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.Occurrence.html#OccName"><span class="hs-identifier hs-type">OccName</span></a></span><span>
</span><span id="line-143"></span><span>               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Name.Cache.html#NameCache"><span class="hs-identifier hs-type">NameCache</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Name.Cache.html#NameCache"><span class="hs-identifier hs-type">NameCache</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621681088921"><span class="hs-identifier hs-type">c</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-144"></span><span>               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="#local-6989586621681088921"><span class="hs-identifier hs-type">c</span></a></span></span><span>
</span><span id="line-145"></span><span id="updNameCacheIO"><span class="annot"><span class="annottext">updNameCacheIO :: forall c.
HscEnv
-&gt; Module -&gt; OccName -&gt; (NameCache -&gt; (NameCache, c)) -&gt; IO c
</span><a href="GHC.Iface.Env.html#updNameCacheIO"><span class="hs-identifier hs-var hs-var">updNameCacheIO</span></a></span></span><span> </span><span id="local-6989586621681088735"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681088735"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span id="local-6989586621681088734"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681088734"><span class="hs-identifier hs-var">mod</span></a></span></span><span> </span><span id="local-6989586621681088733"><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681088733"><span class="hs-identifier hs-var">occ</span></a></span></span><span> </span><span id="local-6989586621681088732"><span class="annot"><span class="annottext">NameCache -&gt; (NameCache, c)
</span><a href="#local-6989586621681088732"><span class="hs-identifier hs-var">upd_fn</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-146"></span><span>
</span><span id="line-147"></span><span>    </span><span class="hs-comment">-- First ensure that mod and occ are evaluated</span><span>
</span><span id="line-148"></span><span>    </span><span class="hs-comment">-- If not, chaos can ensue:</span><span>
</span><span id="line-149"></span><span>    </span><span class="hs-comment">--      we read the name-cache</span><span>
</span><span id="line-150"></span><span>    </span><span class="hs-comment">--      then pull on mod (say)</span><span>
</span><span id="line-151"></span><span>    </span><span class="hs-comment">--      which does some stuff that modifies the name cache</span><span>
</span><span id="line-152"></span><span>    </span><span class="hs-comment">-- This did happen, with tycon_mod in GHC.IfaceToCore.tcIfaceAlt (DataAlt..)</span><span>
</span><span id="line-153"></span><span>
</span><span id="line-154"></span><span>    </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681088734"><span class="hs-identifier hs-var">mod</span></a></span><span> </span><span class="annot"><span class="annottext">Module -&gt; IO () -&gt; IO ()
</span><span class="hs-operator hs-var">`seq`</span></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681088733"><span class="hs-identifier hs-var">occ</span></a></span><span> </span><span class="annot"><span class="annottext">OccName -&gt; IO () -&gt; IO ()
</span><span class="hs-operator hs-var">`seq`</span></span><span> </span><span class="annot"><span class="annottext">() -&gt; IO ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-155"></span><span>  </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">IORef NameCache -&gt; (NameCache -&gt; (NameCache, c)) -&gt; IO c
forall c. IORef NameCache -&gt; (NameCache -&gt; (NameCache, c)) -&gt; IO c
</span><a href="GHC.Driver.Types.html#updNameCache"><span class="hs-identifier hs-var">updNameCache</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv -&gt; IORef NameCache
</span><a href="GHC.Driver.Types.html#hsc_NC"><span class="hs-identifier hs-var hs-var">hsc_NC</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681088735"><span class="hs-identifier hs-var">hsc_env</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">NameCache -&gt; (NameCache, c)
</span><a href="#local-6989586621681088732"><span class="hs-identifier hs-var">upd_fn</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-156"></span><span>
</span><span id="line-157"></span><span>
</span><span id="line-158"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
                Name cache access
*                                                                      *
************************************************************************
-}</span><span>
</span><span id="line-165"></span><span>
</span><span id="line-166"></span><span class="hs-comment">-- | Look up the 'Name' for a given 'Module' and 'OccName'.</span><span>
</span><span id="line-167"></span><span class="hs-comment">-- Consider alternatively using 'lookupIfaceTop' if you're in the 'IfL' monad</span><span>
</span><span id="line-168"></span><span class="hs-comment">-- and 'Module' is simply that of the 'ModIface' you are typechecking.</span><span>
</span><span id="line-169"></span><span id="local-6989586621681088888"><span id="local-6989586621681088889"><span class="annot"><a href="GHC.Iface.Env.html#lookupOrig"><span class="hs-identifier hs-type">lookupOrig</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#Module"><span class="hs-identifier hs-type">Module</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.Occurrence.html#OccName"><span class="hs-identifier hs-type">OccName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcRnIf"><span class="hs-identifier hs-type">TcRnIf</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681088889"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681088888"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span></span></span><span>
</span><span id="line-170"></span><span id="lookupOrig"><span class="annot"><span class="annottext">lookupOrig :: forall a b. Module -&gt; OccName -&gt; TcRnIf a b Name
</span><a href="GHC.Iface.Env.html#lookupOrig"><span class="hs-identifier hs-var hs-var">lookupOrig</span></a></span></span><span> </span><span id="local-6989586621681088728"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681088728"><span class="hs-identifier hs-var">mod</span></a></span></span><span> </span><span id="local-6989586621681088727"><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681088727"><span class="hs-identifier hs-var">occ</span></a></span></span><span>
</span><span id="line-171"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; TcRnIf a b ()
forall m n. SDoc -&gt; TcRnIf m n ()
</span><a href="GHC.Tc.Utils.Monad.html#traceIf"><span class="hs-identifier hs-var">traceIf</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;lookup_orig&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Module -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681088728"><span class="hs-identifier hs-var">mod</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">OccName -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681088727"><span class="hs-identifier hs-var">occ</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-172"></span><span>
</span><span id="line-173"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Module
-&gt; OccName -&gt; (NameCache -&gt; (NameCache, Name)) -&gt; TcRnIf a b Name
forall c a b.
Module -&gt; OccName -&gt; (NameCache -&gt; (NameCache, c)) -&gt; TcRnIf a b c
</span><a href="GHC.Iface.Env.html#updNameCacheTc"><span class="hs-identifier hs-var">updNameCacheTc</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681088728"><span class="hs-identifier hs-var">mod</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681088727"><span class="hs-identifier hs-var">occ</span></a></span><span> </span><span class="annot"><span class="annottext">((NameCache -&gt; (NameCache, Name)) -&gt; TcRnIf a b Name)
-&gt; (NameCache -&gt; (NameCache, Name)) -&gt; TcRnIf a b Name
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Module -&gt; OccName -&gt; NameCache -&gt; (NameCache, Name)
</span><a href="GHC.Iface.Env.html#lookupNameCache"><span class="hs-identifier hs-var">lookupNameCache</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681088728"><span class="hs-identifier hs-var">mod</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681088727"><span class="hs-identifier hs-var">occ</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-174"></span><span>
</span><span id="line-175"></span><span class="annot"><a href="GHC.Iface.Env.html#lookupOrigIO"><span class="hs-identifier hs-type">lookupOrigIO</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#HscEnv"><span class="hs-identifier hs-type">HscEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#Module"><span class="hs-identifier hs-type">Module</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.Occurrence.html#OccName"><span class="hs-identifier hs-type">OccName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span>
</span><span id="line-176"></span><span id="lookupOrigIO"><span class="annot"><span class="annottext">lookupOrigIO :: HscEnv -&gt; Module -&gt; OccName -&gt; IO Name
</span><a href="GHC.Iface.Env.html#lookupOrigIO"><span class="hs-identifier hs-var hs-var">lookupOrigIO</span></a></span></span><span> </span><span id="local-6989586621681088725"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681088725"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span id="local-6989586621681088724"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681088724"><span class="hs-identifier hs-var">mod</span></a></span></span><span> </span><span id="local-6989586621681088723"><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681088723"><span class="hs-identifier hs-var">occ</span></a></span></span><span>
</span><span id="line-177"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscEnv
-&gt; Module -&gt; OccName -&gt; (NameCache -&gt; (NameCache, Name)) -&gt; IO Name
forall c.
HscEnv
-&gt; Module -&gt; OccName -&gt; (NameCache -&gt; (NameCache, c)) -&gt; IO c
</span><a href="GHC.Iface.Env.html#updNameCacheIO"><span class="hs-identifier hs-var">updNameCacheIO</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681088725"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681088724"><span class="hs-identifier hs-var">mod</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681088723"><span class="hs-identifier hs-var">occ</span></a></span><span> </span><span class="annot"><span class="annottext">((NameCache -&gt; (NameCache, Name)) -&gt; IO Name)
-&gt; (NameCache -&gt; (NameCache, Name)) -&gt; IO Name
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Module -&gt; OccName -&gt; NameCache -&gt; (NameCache, Name)
</span><a href="GHC.Iface.Env.html#lookupNameCache"><span class="hs-identifier hs-var">lookupNameCache</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681088724"><span class="hs-identifier hs-var">mod</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681088723"><span class="hs-identifier hs-var">occ</span></a></span><span>
</span><span id="line-178"></span><span>
</span><span id="line-179"></span><span class="annot"><a href="GHC.Iface.Env.html#lookupNameCache"><span class="hs-identifier hs-type">lookupNameCache</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#Module"><span class="hs-identifier hs-type">Module</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.Occurrence.html#OccName"><span class="hs-identifier hs-type">OccName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.Cache.html#NameCache"><span class="hs-identifier hs-type">NameCache</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Name.Cache.html#NameCache"><span class="hs-identifier hs-type">NameCache</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-180"></span><span class="hs-comment">-- Lookup up the (Module,OccName) in the NameCache</span><span>
</span><span id="line-181"></span><span class="hs-comment">-- If you find it, return it; if not, allocate a fresh original name and extend</span><span>
</span><span id="line-182"></span><span class="hs-comment">-- the NameCache.</span><span>
</span><span id="line-183"></span><span class="hs-comment">-- Reason: this may the first occurrence of (say) Foo.bar we have encountered.</span><span>
</span><span id="line-184"></span><span class="hs-comment">-- If we need to explore its value we will load Foo.hi; but meanwhile all we</span><span>
</span><span id="line-185"></span><span class="hs-comment">-- need is a Name for it.</span><span>
</span><span id="line-186"></span><span id="lookupNameCache"><span class="annot"><span class="annottext">lookupNameCache :: Module -&gt; OccName -&gt; NameCache -&gt; (NameCache, Name)
</span><a href="GHC.Iface.Env.html#lookupNameCache"><span class="hs-identifier hs-var hs-var">lookupNameCache</span></a></span></span><span> </span><span id="local-6989586621681088722"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681088722"><span class="hs-identifier hs-var">mod</span></a></span></span><span> </span><span id="local-6989586621681088721"><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681088721"><span class="hs-identifier hs-var">occ</span></a></span></span><span> </span><span id="local-6989586621681088720"><span class="annot"><span class="annottext">NameCache
</span><a href="#local-6989586621681088720"><span class="hs-identifier hs-var">name_cache</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-187"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">OrigNameCache -&gt; Module -&gt; OccName -&gt; Maybe Name
</span><a href="GHC.Types.Name.Cache.html#lookupOrigNameCache"><span class="hs-identifier hs-var">lookupOrigNameCache</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">NameCache -&gt; OrigNameCache
</span><a href="GHC.Types.Name.Cache.html#nsNames"><span class="hs-identifier hs-var hs-var">nsNames</span></a></span><span> </span><span class="annot"><span class="annottext">NameCache
</span><a href="#local-6989586621681088720"><span class="hs-identifier hs-var">name_cache</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681088722"><span class="hs-identifier hs-var">mod</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681088721"><span class="hs-identifier hs-var">occ</span></a></span><span> </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-188"></span><span>    </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681088719"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681088719"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">NameCache
</span><a href="#local-6989586621681088720"><span class="hs-identifier hs-var">name_cache</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681088719"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span class="hs-special">;</span><span>
</span><span id="line-189"></span><span>    </span><span class="annot"><span class="annottext">Maybe Name
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>   </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-190"></span><span>        </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">UniqSupply -&gt; (Unique, UniqSupply)
</span><a href="GHC.Types.Unique.Supply.html#takeUniqFromSupply"><span class="hs-identifier hs-var">takeUniqFromSupply</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">NameCache -&gt; UniqSupply
</span><a href="GHC.Types.Name.Cache.html#nsUniqs"><span class="hs-identifier hs-var hs-var">nsUniqs</span></a></span><span> </span><span class="annot"><span class="annottext">NameCache
</span><a href="#local-6989586621681088720"><span class="hs-identifier hs-var">name_cache</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-191"></span><span>          </span><span class="hs-special">(</span><span id="local-6989586621681088718"><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621681088718"><span class="hs-identifier hs-var">uniq</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681088717"><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681088717"><span class="hs-identifier hs-var">us</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-192"></span><span>              </span><span class="hs-keyword">let</span><span>
</span><span id="line-193"></span><span>                </span><span id="local-6989586621681088716"><span class="annot"><span class="annottext">name :: Name
</span><a href="#local-6989586621681088716"><span class="hs-identifier hs-var hs-var">name</span></a></span></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Unique -&gt; Module -&gt; OccName -&gt; SrcSpan -&gt; Name
</span><a href="GHC.Types.Name.html#mkExternalName"><span class="hs-identifier hs-var">mkExternalName</span></a></span><span> </span><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621681088718"><span class="hs-identifier hs-var">uniq</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681088722"><span class="hs-identifier hs-var">mod</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681088721"><span class="hs-identifier hs-var">occ</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="GHC.Types.SrcLoc.html#noSrcSpan"><span class="hs-identifier hs-var">noSrcSpan</span></a></span><span>
</span><span id="line-194"></span><span>                </span><span id="local-6989586621681088714"><span class="annot"><span class="annottext">new_cache :: OrigNameCache
</span><a href="#local-6989586621681088714"><span class="hs-identifier hs-var hs-var">new_cache</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">OrigNameCache -&gt; Module -&gt; OccName -&gt; Name -&gt; OrigNameCache
</span><a href="GHC.Types.Name.Cache.html#extendNameCache"><span class="hs-identifier hs-var">extendNameCache</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">NameCache -&gt; OrigNameCache
</span><a href="GHC.Types.Name.Cache.html#nsNames"><span class="hs-identifier hs-var hs-var">nsNames</span></a></span><span> </span><span class="annot"><span class="annottext">NameCache
</span><a href="#local-6989586621681088720"><span class="hs-identifier hs-var">name_cache</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681088722"><span class="hs-identifier hs-var">mod</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681088721"><span class="hs-identifier hs-var">occ</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681088716"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-195"></span><span>              </span><span class="hs-keyword">in</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">NameCache
</span><a href="#local-6989586621681088720"><span class="hs-identifier hs-var">name_cache</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">nsUniqs :: UniqSupply
</span><a href="GHC.Types.Name.Cache.html#nsUniqs"><span class="hs-identifier hs-var">nsUniqs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681088717"><span class="hs-identifier hs-var">us</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">nsNames :: OrigNameCache
</span><a href="GHC.Types.Name.Cache.html#nsNames"><span class="hs-identifier hs-var">nsNames</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">OrigNameCache
</span><a href="#local-6989586621681088714"><span class="hs-identifier hs-var">new_cache</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681088716"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span class="hs-special">}</span><span>
</span><span id="line-196"></span><span>
</span><span id="line-197"></span><span id="local-6989586621681088884"><span id="local-6989586621681088885"><span class="annot"><a href="GHC.Iface.Env.html#externaliseName"><span class="hs-identifier hs-type">externaliseName</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#Module"><span class="hs-identifier hs-type">Module</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcRnIf"><span class="hs-identifier hs-type">TcRnIf</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681088885"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681088884"><span class="hs-identifier hs-type">n</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span></span></span><span>
</span><span id="line-198"></span><span class="hs-comment">-- Take an Internal Name and make it an External one,</span><span>
</span><span id="line-199"></span><span class="hs-comment">-- with the same unique</span><span>
</span><span id="line-200"></span><span id="externaliseName"><span class="annot"><span class="annottext">externaliseName :: forall m n. Module -&gt; Name -&gt; TcRnIf m n Name
</span><a href="GHC.Iface.Env.html#externaliseName"><span class="hs-identifier hs-var hs-var">externaliseName</span></a></span></span><span> </span><span id="local-6989586621681088711"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681088711"><span class="hs-identifier hs-var">mod</span></a></span></span><span> </span><span id="local-6989586621681088710"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681088710"><span class="hs-identifier hs-var">name</span></a></span></span><span>
</span><span id="line-201"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681088709"><span class="annot"><span class="annottext">occ :: OccName
</span><a href="#local-6989586621681088709"><span class="hs-identifier hs-var hs-var">occ</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; OccName
</span><a href="GHC.Types.Name.html#nameOccName"><span class="hs-identifier hs-var">nameOccName</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681088710"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-202"></span><span>             </span><span id="local-6989586621681088707"><span class="annot"><span class="annottext">loc :: SrcSpan
</span><a href="#local-6989586621681088707"><span class="hs-identifier hs-var hs-var">loc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; SrcSpan
</span><a href="GHC.Types.Name.html#nameSrcSpan"><span class="hs-identifier hs-var">nameSrcSpan</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681088710"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-203"></span><span>             </span><span id="local-6989586621681088705"><span class="annot"><span class="annottext">uniq :: Unique
</span><a href="#local-6989586621681088705"><span class="hs-identifier hs-var hs-var">uniq</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Unique
</span><a href="GHC.Types.Name.html#nameUnique"><span class="hs-identifier hs-var">nameUnique</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681088710"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-204"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681088709"><span class="hs-identifier hs-var">occ</span></a></span><span> </span><span class="annot"><span class="annottext">OccName -&gt; IOEnv (Env m n) () -&gt; IOEnv (Env m n) ()
</span><span class="hs-operator hs-var">`seq`</span></span><span> </span><span class="annot"><span class="annottext">() -&gt; IOEnv (Env m n) ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>  </span><span class="hs-comment">-- c.f. seq in newGlobalBinder</span><span>
</span><span id="line-205"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Module
-&gt; OccName -&gt; (NameCache -&gt; (NameCache, Name)) -&gt; TcRnIf m n Name
forall c a b.
Module -&gt; OccName -&gt; (NameCache -&gt; (NameCache, c)) -&gt; TcRnIf a b c
</span><a href="GHC.Iface.Env.html#updNameCacheTc"><span class="hs-identifier hs-var">updNameCacheTc</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681088711"><span class="hs-identifier hs-var">mod</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681088709"><span class="hs-identifier hs-var">occ</span></a></span><span> </span><span class="annot"><span class="annottext">((NameCache -&gt; (NameCache, Name)) -&gt; TcRnIf m n Name)
-&gt; (NameCache -&gt; (NameCache, Name)) -&gt; TcRnIf m n Name
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621681088704"><span class="annot"><span class="annottext">NameCache
</span><a href="#local-6989586621681088704"><span class="hs-identifier hs-var">ns</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-206"></span><span>         </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681088703"><span class="annot"><span class="annottext">name' :: Name
</span><a href="#local-6989586621681088703"><span class="hs-identifier hs-var hs-var">name'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Unique -&gt; Module -&gt; OccName -&gt; SrcSpan -&gt; Name
</span><a href="GHC.Types.Name.html#mkExternalName"><span class="hs-identifier hs-var">mkExternalName</span></a></span><span> </span><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621681088705"><span class="hs-identifier hs-var">uniq</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681088711"><span class="hs-identifier hs-var">mod</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681088709"><span class="hs-identifier hs-var">occ</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681088707"><span class="hs-identifier hs-var">loc</span></a></span><span>
</span><span id="line-207"></span><span>             </span><span id="local-6989586621681088702"><span class="annot"><span class="annottext">ns' :: NameCache
</span><a href="#local-6989586621681088702"><span class="hs-identifier hs-var hs-var">ns'</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">NameCache
</span><a href="#local-6989586621681088704"><span class="hs-identifier hs-var">ns</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">nsNames :: OrigNameCache
</span><a href="GHC.Types.Name.Cache.html#nsNames"><span class="hs-identifier hs-var">nsNames</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">OrigNameCache -&gt; Module -&gt; OccName -&gt; Name -&gt; OrigNameCache
</span><a href="GHC.Types.Name.Cache.html#extendNameCache"><span class="hs-identifier hs-var">extendNameCache</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">NameCache -&gt; OrigNameCache
</span><a href="GHC.Types.Name.Cache.html#nsNames"><span class="hs-identifier hs-var hs-var">nsNames</span></a></span><span> </span><span class="annot"><span class="annottext">NameCache
</span><a href="#local-6989586621681088704"><span class="hs-identifier hs-var">ns</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681088711"><span class="hs-identifier hs-var">mod</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681088709"><span class="hs-identifier hs-var">occ</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681088703"><span class="hs-identifier hs-var">name'</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-208"></span><span>         </span><span class="hs-keyword">in</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">NameCache
</span><a href="#local-6989586621681088702"><span class="hs-identifier hs-var">ns'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681088703"><span class="hs-identifier hs-var">name'</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-209"></span><span>
</span><span id="line-210"></span><span class="hs-comment">-- | Set the 'Module' of a 'Name'.</span><span>
</span><span id="line-211"></span><span id="local-6989586621681088880"><span id="local-6989586621681088881"><span class="annot"><a href="GHC.Iface.Env.html#setNameModule"><span class="hs-identifier hs-type">setNameModule</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#Module"><span class="hs-identifier hs-type">Module</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcRnIf"><span class="hs-identifier hs-type">TcRnIf</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681088881"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681088880"><span class="hs-identifier hs-type">n</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span></span></span><span>
</span><span id="line-212"></span><span id="setNameModule"><span class="annot"><span class="annottext">setNameModule :: forall m n. Maybe Module -&gt; Name -&gt; TcRnIf m n Name
</span><a href="GHC.Iface.Env.html#setNameModule"><span class="hs-identifier hs-var hs-var">setNameModule</span></a></span></span><span> </span><span class="annot"><span class="annottext">Maybe Module
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span id="local-6989586621681088700"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681088700"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; IOEnv (Env m n) Name
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681088700"><span class="hs-identifier hs-var">n</span></a></span><span>
</span><span id="line-213"></span><span class="annot"><a href="GHC.Iface.Env.html#setNameModule"><span class="hs-identifier hs-var">setNameModule</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681088699"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681088699"><span class="hs-identifier hs-var">m</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681088698"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681088698"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-214"></span><span>    </span><span class="annot"><span class="annottext">Module -&gt; OccName -&gt; SrcSpan -&gt; IOEnv (Env m n) Name
forall a b. Module -&gt; OccName -&gt; SrcSpan -&gt; TcRnIf a b Name
</span><a href="GHC.Iface.Env.html#newGlobalBinder"><span class="hs-identifier hs-var">newGlobalBinder</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681088699"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; OccName
</span><a href="GHC.Types.Name.html#nameOccName"><span class="hs-identifier hs-var">nameOccName</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681088698"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; SrcSpan
</span><a href="GHC.Types.Name.html#nameSrcSpan"><span class="hs-identifier hs-var">nameSrcSpan</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681088698"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-215"></span><span>
</span><span id="line-216"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
                Type variables and local Ids
*                                                                      *
************************************************************************
-}</span><span>
</span><span id="line-223"></span><span>
</span><span id="line-224"></span><span class="annot"><a href="GHC.Iface.Env.html#tcIfaceLclId"><span class="hs-identifier hs-type">tcIfaceLclId</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#IfL"><span class="hs-identifier hs-type">IfL</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span>
</span><span id="line-225"></span><span id="tcIfaceLclId"><span class="annot"><span class="annottext">tcIfaceLclId :: FastString -&gt; IfL Id
</span><a href="GHC.Iface.Env.html#tcIfaceLclId"><span class="hs-identifier hs-var hs-var">tcIfaceLclId</span></a></span></span><span> </span><span id="local-6989586621681088697"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681088697"><span class="hs-identifier hs-var">occ</span></a></span></span><span>
</span><span id="line-226"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681088696"><span class="annot"><span class="annottext">IfLclEnv
</span><a href="#local-6989586621681088696"><span class="hs-identifier hs-var">lcl</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcRnIf IfGblEnv IfLclEnv IfLclEnv
forall gbl lcl. TcRnIf gbl lcl lcl
</span><a href="GHC.Tc.Utils.Monad.html#getLclEnv"><span class="hs-identifier hs-var">getLclEnv</span></a></span><span>
</span><span id="line-227"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FastStringEnv Id -&gt; FastString -&gt; Maybe Id
forall a. FastStringEnv a -&gt; FastString -&gt; Maybe a
</span><a href="GHC.Data.FastString.Env.html#lookupFsEnv"><span class="hs-identifier hs-var">lookupFsEnv</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IfLclEnv -&gt; FastStringEnv Id
</span><a href="GHC.Tc.Types.html#if_id_env"><span class="hs-identifier hs-var hs-var">if_id_env</span></a></span><span> </span><span class="annot"><span class="annottext">IfLclEnv
</span><a href="#local-6989586621681088696"><span class="hs-identifier hs-var">lcl</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681088697"><span class="hs-identifier hs-var">occ</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-228"></span><span>            </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681088692"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681088692"><span class="hs-identifier hs-var">ty_var</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Id -&gt; IfL Id
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681088692"><span class="hs-identifier hs-var">ty_var</span></a></span><span>
</span><span id="line-229"></span><span>            </span><span class="annot"><span class="annottext">Maybe Id
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>     </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; IfL Id
forall a. SDoc -&gt; IfL a
</span><a href="GHC.Tc.Utils.Monad.html#failIfM"><span class="hs-identifier hs-var">failIfM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Iface id out of scope: &quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">FastString -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681088697"><span class="hs-identifier hs-var">occ</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-230"></span><span>        </span><span class="hs-special">}</span><span>
</span><span id="line-231"></span><span>
</span><span id="line-232"></span><span id="local-6989586621681088870"><span class="annot"><a href="GHC.Iface.Env.html#extendIfaceIdEnv"><span class="hs-identifier hs-type">extendIfaceIdEnv</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#IfL"><span class="hs-identifier hs-type">IfL</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681088870"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#IfL"><span class="hs-identifier hs-type">IfL</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681088870"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-233"></span><span id="extendIfaceIdEnv"><span class="annot"><span class="annottext">extendIfaceIdEnv :: forall a. [Id] -&gt; IfL a -&gt; IfL a
</span><a href="GHC.Iface.Env.html#extendIfaceIdEnv"><span class="hs-identifier hs-var hs-var">extendIfaceIdEnv</span></a></span></span><span> </span><span id="local-6989586621681088689"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681088689"><span class="hs-identifier hs-var">ids</span></a></span></span><span> </span><span id="local-6989586621681088688"><span class="annot"><span class="annottext">IfL a
</span><a href="#local-6989586621681088688"><span class="hs-identifier hs-var">thing_inside</span></a></span></span><span>
</span><span id="line-234"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681088687"><span class="annot"><span class="annottext">IfLclEnv
</span><a href="#local-6989586621681088687"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcRnIf IfGblEnv IfLclEnv IfLclEnv
forall gbl lcl. TcRnIf gbl lcl lcl
</span><a href="GHC.Tc.Utils.Monad.html#getLclEnv"><span class="hs-identifier hs-var">getLclEnv</span></a></span><span>
</span><span id="line-235"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681088686"><span class="annot"><span class="annottext">id_env' :: FastStringEnv Id
</span><a href="#local-6989586621681088686"><span class="hs-identifier hs-var hs-var">id_env'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FastStringEnv Id -&gt; [(FastString, Id)] -&gt; FastStringEnv Id
forall a. FastStringEnv a -&gt; [(FastString, a)] -&gt; FastStringEnv a
</span><a href="GHC.Data.FastString.Env.html#extendFsEnvList"><span class="hs-identifier hs-var">extendFsEnvList</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IfLclEnv -&gt; FastStringEnv Id
</span><a href="GHC.Tc.Types.html#if_id_env"><span class="hs-identifier hs-var hs-var">if_id_env</span></a></span><span> </span><span class="annot"><span class="annottext">IfLclEnv
</span><a href="#local-6989586621681088687"><span class="hs-identifier hs-var">env</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[(FastString, Id)]
</span><a href="#local-6989586621681088684"><span class="hs-identifier hs-var">pairs</span></a></span><span>
</span><span id="line-236"></span><span>              </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681088684"><span class="annot"><span class="annottext">pairs :: [(FastString, Id)]
</span><a href="#local-6989586621681088684"><span class="hs-identifier hs-var hs-var">pairs</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">OccName -&gt; FastString
</span><a href="GHC.Types.Name.Occurrence.html#occNameFS"><span class="hs-identifier hs-var hs-var">occNameFS</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; OccName
forall a. NamedThing a =&gt; a -&gt; OccName
</span><a href="GHC.Types.Name.html#getOccName"><span class="hs-identifier hs-var">getOccName</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681088679"><span class="hs-identifier hs-var">id</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681088679"><span class="hs-identifier hs-var">id</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621681088679"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681088679"><span class="hs-identifier hs-var">id</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681088689"><span class="hs-identifier hs-var">ids</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-237"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">IfLclEnv -&gt; IfL a -&gt; IfL a
forall lcl' gbl a lcl.
lcl' -&gt; TcRnIf gbl lcl' a -&gt; TcRnIf gbl lcl a
</span><a href="GHC.Tc.Utils.Monad.html#setLclEnv"><span class="hs-identifier hs-var">setLclEnv</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IfLclEnv
</span><a href="#local-6989586621681088687"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">if_id_env :: FastStringEnv Id
</span><a href="GHC.Tc.Types.html#if_id_env"><span class="hs-identifier hs-var">if_id_env</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FastStringEnv Id
</span><a href="#local-6989586621681088686"><span class="hs-identifier hs-var">id_env'</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">IfL a
</span><a href="#local-6989586621681088688"><span class="hs-identifier hs-var">thing_inside</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-238"></span><span>
</span><span id="line-239"></span><span>
</span><span id="line-240"></span><span class="annot"><a href="GHC.Iface.Env.html#tcIfaceTyVar"><span class="hs-identifier hs-type">tcIfaceTyVar</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#IfL"><span class="hs-identifier hs-type">IfL</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Var.html#TyVar"><span class="hs-identifier hs-type">TyVar</span></a></span><span>
</span><span id="line-241"></span><span id="tcIfaceTyVar"><span class="annot"><span class="annottext">tcIfaceTyVar :: FastString -&gt; IfL Id
</span><a href="GHC.Iface.Env.html#tcIfaceTyVar"><span class="hs-identifier hs-var hs-var">tcIfaceTyVar</span></a></span></span><span> </span><span id="local-6989586621681088676"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681088676"><span class="hs-identifier hs-var">occ</span></a></span></span><span>
</span><span id="line-242"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681088675"><span class="annot"><span class="annottext">IfLclEnv
</span><a href="#local-6989586621681088675"><span class="hs-identifier hs-var">lcl</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcRnIf IfGblEnv IfLclEnv IfLclEnv
forall gbl lcl. TcRnIf gbl lcl lcl
</span><a href="GHC.Tc.Utils.Monad.html#getLclEnv"><span class="hs-identifier hs-var">getLclEnv</span></a></span><span>
</span><span id="line-243"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FastStringEnv Id -&gt; FastString -&gt; Maybe Id
forall a. FastStringEnv a -&gt; FastString -&gt; Maybe a
</span><a href="GHC.Data.FastString.Env.html#lookupFsEnv"><span class="hs-identifier hs-var">lookupFsEnv</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IfLclEnv -&gt; FastStringEnv Id
</span><a href="GHC.Tc.Types.html#if_tv_env"><span class="hs-identifier hs-var hs-var">if_tv_env</span></a></span><span> </span><span class="annot"><span class="annottext">IfLclEnv
</span><a href="#local-6989586621681088675"><span class="hs-identifier hs-var">lcl</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681088676"><span class="hs-identifier hs-var">occ</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-244"></span><span>            </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681088673"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681088673"><span class="hs-identifier hs-var">ty_var</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Id -&gt; IfL Id
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681088673"><span class="hs-identifier hs-var">ty_var</span></a></span><span>
</span><span id="line-245"></span><span>            </span><span class="annot"><span class="annottext">Maybe Id
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>     </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; IfL Id
forall a. SDoc -&gt; IfL a
</span><a href="GHC.Tc.Utils.Monad.html#failIfM"><span class="hs-identifier hs-var">failIfM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Iface type variable out of scope: &quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">FastString -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681088676"><span class="hs-identifier hs-var">occ</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-246"></span><span>        </span><span class="hs-special">}</span><span>
</span><span id="line-247"></span><span>
</span><span id="line-248"></span><span class="annot"><a href="GHC.Iface.Env.html#lookupIfaceTyVar"><span class="hs-identifier hs-type">lookupIfaceTyVar</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Iface.Type.html#IfaceTvBndr"><span class="hs-identifier hs-type">IfaceTvBndr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#IfL"><span class="hs-identifier hs-type">IfL</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Var.html#TyVar"><span class="hs-identifier hs-type">TyVar</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-249"></span><span id="lookupIfaceTyVar"><span class="annot"><span class="annottext">lookupIfaceTyVar :: IfaceTvBndr -&gt; IfL (Maybe Id)
</span><a href="GHC.Iface.Env.html#lookupIfaceTyVar"><span class="hs-identifier hs-var hs-var">lookupIfaceTyVar</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681088672"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681088672"><span class="hs-identifier hs-var">occ</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">IfaceKind
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>
</span><span id="line-250"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681088671"><span class="annot"><span class="annottext">IfLclEnv
</span><a href="#local-6989586621681088671"><span class="hs-identifier hs-var">lcl</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcRnIf IfGblEnv IfLclEnv IfLclEnv
forall gbl lcl. TcRnIf gbl lcl lcl
</span><a href="GHC.Tc.Utils.Monad.html#getLclEnv"><span class="hs-identifier hs-var">getLclEnv</span></a></span><span>
</span><span id="line-251"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Maybe Id -&gt; IfL (Maybe Id)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FastStringEnv Id -&gt; FastString -&gt; Maybe Id
forall a. FastStringEnv a -&gt; FastString -&gt; Maybe a
</span><a href="GHC.Data.FastString.Env.html#lookupFsEnv"><span class="hs-identifier hs-var">lookupFsEnv</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IfLclEnv -&gt; FastStringEnv Id
</span><a href="GHC.Tc.Types.html#if_tv_env"><span class="hs-identifier hs-var hs-var">if_tv_env</span></a></span><span> </span><span class="annot"><span class="annottext">IfLclEnv
</span><a href="#local-6989586621681088671"><span class="hs-identifier hs-var">lcl</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681088672"><span class="hs-identifier hs-var">occ</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-252"></span><span>
</span><span id="line-253"></span><span class="annot"><a href="GHC.Iface.Env.html#lookupIfaceVar"><span class="hs-identifier hs-type">lookupIfaceVar</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Iface.Type.html#IfaceBndr"><span class="hs-identifier hs-type">IfaceBndr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#IfL"><span class="hs-identifier hs-type">IfL</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Var.html#TyCoVar"><span class="hs-identifier hs-type">TyCoVar</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-254"></span><span id="lookupIfaceVar"><span class="annot"><span class="annottext">lookupIfaceVar :: IfaceBndr -&gt; IfL (Maybe Id)
</span><a href="GHC.Iface.Env.html#lookupIfaceVar"><span class="hs-identifier hs-var hs-var">lookupIfaceVar</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Iface.Type.html#IfaceIdBndr"><span class="hs-identifier hs-type">IfaceIdBndr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IfaceKind
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681088668"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681088668"><span class="hs-identifier hs-var">occ</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">IfaceKind
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-255"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681088667"><span class="annot"><span class="annottext">IfLclEnv
</span><a href="#local-6989586621681088667"><span class="hs-identifier hs-var">lcl</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcRnIf IfGblEnv IfLclEnv IfLclEnv
forall gbl lcl. TcRnIf gbl lcl lcl
</span><a href="GHC.Tc.Utils.Monad.html#getLclEnv"><span class="hs-identifier hs-var">getLclEnv</span></a></span><span>
</span><span id="line-256"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Maybe Id -&gt; IfL (Maybe Id)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FastStringEnv Id -&gt; FastString -&gt; Maybe Id
forall a. FastStringEnv a -&gt; FastString -&gt; Maybe a
</span><a href="GHC.Data.FastString.Env.html#lookupFsEnv"><span class="hs-identifier hs-var">lookupFsEnv</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IfLclEnv -&gt; FastStringEnv Id
</span><a href="GHC.Tc.Types.html#if_id_env"><span class="hs-identifier hs-var hs-var">if_id_env</span></a></span><span> </span><span class="annot"><span class="annottext">IfLclEnv
</span><a href="#local-6989586621681088667"><span class="hs-identifier hs-var">lcl</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681088668"><span class="hs-identifier hs-var">occ</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-257"></span><span class="annot"><a href="GHC.Iface.Env.html#lookupIfaceVar"><span class="hs-identifier hs-var">lookupIfaceVar</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Iface.Type.html#IfaceTvBndr"><span class="hs-identifier hs-type">IfaceTvBndr</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681088665"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681088665"><span class="hs-identifier hs-var">occ</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">IfaceKind
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-258"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681088664"><span class="annot"><span class="annottext">IfLclEnv
</span><a href="#local-6989586621681088664"><span class="hs-identifier hs-var">lcl</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcRnIf IfGblEnv IfLclEnv IfLclEnv
forall gbl lcl. TcRnIf gbl lcl lcl
</span><a href="GHC.Tc.Utils.Monad.html#getLclEnv"><span class="hs-identifier hs-var">getLclEnv</span></a></span><span>
</span><span id="line-259"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Maybe Id -&gt; IfL (Maybe Id)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FastStringEnv Id -&gt; FastString -&gt; Maybe Id
forall a. FastStringEnv a -&gt; FastString -&gt; Maybe a
</span><a href="GHC.Data.FastString.Env.html#lookupFsEnv"><span class="hs-identifier hs-var">lookupFsEnv</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IfLclEnv -&gt; FastStringEnv Id
</span><a href="GHC.Tc.Types.html#if_tv_env"><span class="hs-identifier hs-var hs-var">if_tv_env</span></a></span><span> </span><span class="annot"><span class="annottext">IfLclEnv
</span><a href="#local-6989586621681088664"><span class="hs-identifier hs-var">lcl</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681088665"><span class="hs-identifier hs-var">occ</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-260"></span><span>
</span><span id="line-261"></span><span id="local-6989586621681088663"><span class="annot"><a href="GHC.Iface.Env.html#extendIfaceTyVarEnv"><span class="hs-identifier hs-type">extendIfaceTyVarEnv</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#TyVar"><span class="hs-identifier hs-type">TyVar</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#IfL"><span class="hs-identifier hs-type">IfL</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681088663"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#IfL"><span class="hs-identifier hs-type">IfL</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681088663"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-262"></span><span id="extendIfaceTyVarEnv"><span class="annot"><span class="annottext">extendIfaceTyVarEnv :: forall a. [Id] -&gt; IfL a -&gt; IfL a
</span><a href="GHC.Iface.Env.html#extendIfaceTyVarEnv"><span class="hs-identifier hs-var hs-var">extendIfaceTyVarEnv</span></a></span></span><span> </span><span id="local-6989586621681088661"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681088661"><span class="hs-identifier hs-var">tyvars</span></a></span></span><span> </span><span id="local-6989586621681088660"><span class="annot"><span class="annottext">IfL a
</span><a href="#local-6989586621681088660"><span class="hs-identifier hs-var">thing_inside</span></a></span></span><span>
</span><span id="line-263"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681088659"><span class="annot"><span class="annottext">IfLclEnv
</span><a href="#local-6989586621681088659"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcRnIf IfGblEnv IfLclEnv IfLclEnv
forall gbl lcl. TcRnIf gbl lcl lcl
</span><a href="GHC.Tc.Utils.Monad.html#getLclEnv"><span class="hs-identifier hs-var">getLclEnv</span></a></span><span>
</span><span id="line-264"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681088658"><span class="annot"><span class="annottext">tv_env' :: FastStringEnv Id
</span><a href="#local-6989586621681088658"><span class="hs-identifier hs-var hs-var">tv_env'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FastStringEnv Id -&gt; [(FastString, Id)] -&gt; FastStringEnv Id
forall a. FastStringEnv a -&gt; [(FastString, a)] -&gt; FastStringEnv a
</span><a href="GHC.Data.FastString.Env.html#extendFsEnvList"><span class="hs-identifier hs-var">extendFsEnvList</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IfLclEnv -&gt; FastStringEnv Id
</span><a href="GHC.Tc.Types.html#if_tv_env"><span class="hs-identifier hs-var hs-var">if_tv_env</span></a></span><span> </span><span class="annot"><span class="annottext">IfLclEnv
</span><a href="#local-6989586621681088659"><span class="hs-identifier hs-var">env</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[(FastString, Id)]
</span><a href="#local-6989586621681088657"><span class="hs-identifier hs-var">pairs</span></a></span><span>
</span><span id="line-265"></span><span>              </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681088657"><span class="annot"><span class="annottext">pairs :: [(FastString, Id)]
</span><a href="#local-6989586621681088657"><span class="hs-identifier hs-var hs-var">pairs</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">OccName -&gt; FastString
</span><a href="GHC.Types.Name.Occurrence.html#occNameFS"><span class="hs-identifier hs-var hs-var">occNameFS</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; OccName
forall a. NamedThing a =&gt; a -&gt; OccName
</span><a href="GHC.Types.Name.html#getOccName"><span class="hs-identifier hs-var">getOccName</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681088655"><span class="hs-identifier hs-var">tv</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681088655"><span class="hs-identifier hs-var">tv</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621681088655"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681088655"><span class="hs-identifier hs-var">tv</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681088661"><span class="hs-identifier hs-var">tyvars</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-266"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">IfLclEnv -&gt; IfL a -&gt; IfL a
forall lcl' gbl a lcl.
lcl' -&gt; TcRnIf gbl lcl' a -&gt; TcRnIf gbl lcl a
</span><a href="GHC.Tc.Utils.Monad.html#setLclEnv"><span class="hs-identifier hs-var">setLclEnv</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IfLclEnv
</span><a href="#local-6989586621681088659"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">if_tv_env :: FastStringEnv Id
</span><a href="GHC.Tc.Types.html#if_tv_env"><span class="hs-identifier hs-var">if_tv_env</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FastStringEnv Id
</span><a href="#local-6989586621681088658"><span class="hs-identifier hs-var">tv_env'</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">IfL a
</span><a href="#local-6989586621681088660"><span class="hs-identifier hs-var">thing_inside</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-267"></span><span>
</span><span id="line-268"></span><span id="local-6989586621681088654"><span class="annot"><a href="GHC.Iface.Env.html#extendIfaceEnvs"><span class="hs-identifier hs-type">extendIfaceEnvs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#TyCoVar"><span class="hs-identifier hs-type">TyCoVar</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#IfL"><span class="hs-identifier hs-type">IfL</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681088654"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#IfL"><span class="hs-identifier hs-type">IfL</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681088654"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-269"></span><span id="extendIfaceEnvs"><span class="annot"><span class="annottext">extendIfaceEnvs :: forall a. [Id] -&gt; IfL a -&gt; IfL a
</span><a href="GHC.Iface.Env.html#extendIfaceEnvs"><span class="hs-identifier hs-var hs-var">extendIfaceEnvs</span></a></span></span><span> </span><span id="local-6989586621681088653"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681088653"><span class="hs-identifier hs-var">tcvs</span></a></span></span><span> </span><span id="local-6989586621681088652"><span class="annot"><span class="annottext">IfL a
</span><a href="#local-6989586621681088652"><span class="hs-identifier hs-var">thing_inside</span></a></span></span><span>
</span><span id="line-270"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; IfL a -&gt; IfL a
forall a. [Id] -&gt; IfL a -&gt; IfL a
</span><a href="GHC.Iface.Env.html#extendIfaceTyVarEnv"><span class="hs-identifier hs-var">extendIfaceTyVarEnv</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681088651"><span class="hs-identifier hs-var">tvs</span></a></span><span> </span><span class="annot"><span class="annottext">(IfL a -&gt; IfL a) -&gt; IfL a -&gt; IfL a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-271"></span><span>    </span><span class="annot"><span class="annottext">[Id] -&gt; IfL a -&gt; IfL a
forall a. [Id] -&gt; IfL a -&gt; IfL a
</span><a href="GHC.Iface.Env.html#extendIfaceIdEnv"><span class="hs-identifier hs-var">extendIfaceIdEnv</span></a></span><span>    </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681088650"><span class="hs-identifier hs-var">cvs</span></a></span><span> </span><span class="annot"><span class="annottext">(IfL a -&gt; IfL a) -&gt; IfL a -&gt; IfL a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-272"></span><span>    </span><span class="annot"><span class="annottext">IfL a
</span><a href="#local-6989586621681088652"><span class="hs-identifier hs-var">thing_inside</span></a></span><span>
</span><span id="line-273"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-274"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621681088651"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681088651"><span class="hs-identifier hs-var">tvs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681088650"><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681088650"><span class="hs-identifier hs-var">cvs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Id -&gt; Bool) -&gt; [Id] -&gt; ([Id], [Id])
forall a. (a -&gt; Bool) -&gt; [a] -&gt; ([a], [a])
</span><a href="../../base/src/Data.OldList.html#partition"><span class="hs-identifier hs-var">partition</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; Bool
</span><a href="GHC.Types.Var.html#isTyVar"><span class="hs-identifier hs-var">isTyVar</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681088653"><span class="hs-identifier hs-var">tcvs</span></a></span><span>
</span><span id="line-275"></span><span>
</span><span id="line-276"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
                Getting from RdrNames to Names
*                                                                      *
************************************************************************
-}</span><span>
</span><span id="line-283"></span><span>
</span><span id="line-284"></span><span class="hs-comment">-- | Look up a top-level name from the current Iface module</span><span>
</span><span id="line-285"></span><span class="annot"><a href="GHC.Iface.Env.html#lookupIfaceTop"><span class="hs-identifier hs-type">lookupIfaceTop</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.Occurrence.html#OccName"><span class="hs-identifier hs-type">OccName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#IfL"><span class="hs-identifier hs-type">IfL</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span>
</span><span id="line-286"></span><span id="lookupIfaceTop"><span class="annot"><span class="annottext">lookupIfaceTop :: OccName -&gt; IfL Name
</span><a href="GHC.Iface.Env.html#lookupIfaceTop"><span class="hs-identifier hs-var hs-var">lookupIfaceTop</span></a></span></span><span> </span><span id="local-6989586621681088648"><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681088648"><span class="hs-identifier hs-var">occ</span></a></span></span><span>
</span><span id="line-287"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681088647"><span class="annot"><span class="annottext">IfLclEnv
</span><a href="#local-6989586621681088647"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcRnIf IfGblEnv IfLclEnv IfLclEnv
forall gbl lcl. TcRnIf gbl lcl lcl
</span><a href="GHC.Tc.Utils.Monad.html#getLclEnv"><span class="hs-identifier hs-var">getLclEnv</span></a></span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Module -&gt; OccName -&gt; IfL Name
forall a b. Module -&gt; OccName -&gt; TcRnIf a b Name
</span><a href="GHC.Iface.Env.html#lookupOrig"><span class="hs-identifier hs-var">lookupOrig</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IfLclEnv -&gt; Module
</span><a href="GHC.Tc.Types.html#if_mod"><span class="hs-identifier hs-var hs-var">if_mod</span></a></span><span> </span><span class="annot"><span class="annottext">IfLclEnv
</span><a href="#local-6989586621681088647"><span class="hs-identifier hs-var">env</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681088648"><span class="hs-identifier hs-var">occ</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-288"></span><span>
</span><span id="line-289"></span><span class="annot"><a href="GHC.Iface.Env.html#newIfaceName"><span class="hs-identifier hs-type">newIfaceName</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.Occurrence.html#OccName"><span class="hs-identifier hs-type">OccName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#IfL"><span class="hs-identifier hs-type">IfL</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span>
</span><span id="line-290"></span><span id="newIfaceName"><span class="annot"><span class="annottext">newIfaceName :: OccName -&gt; IfL Name
</span><a href="GHC.Iface.Env.html#newIfaceName"><span class="hs-identifier hs-var hs-var">newIfaceName</span></a></span></span><span> </span><span id="local-6989586621681088645"><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681088645"><span class="hs-identifier hs-var">occ</span></a></span></span><span>
</span><span id="line-291"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681088644"><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621681088644"><span class="hs-identifier hs-var">uniq</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcRnIf IfGblEnv IfLclEnv Unique
forall gbl lcl. TcRnIf gbl lcl Unique
</span><a href="GHC.Tc.Utils.Monad.html#newUnique"><span class="hs-identifier hs-var">newUnique</span></a></span><span>
</span><span id="line-292"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Name -&gt; IfL Name
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(Name -&gt; IfL Name) -&gt; Name -&gt; IfL Name
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="annot"><span class="annottext">Unique -&gt; OccName -&gt; SrcSpan -&gt; Name
</span><a href="GHC.Types.Name.html#mkInternalName"><span class="hs-identifier hs-var">mkInternalName</span></a></span><span> </span><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621681088644"><span class="hs-identifier hs-var">uniq</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681088645"><span class="hs-identifier hs-var">occ</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="GHC.Types.SrcLoc.html#noSrcSpan"><span class="hs-identifier hs-var">noSrcSpan</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-293"></span><span>
</span><span id="line-294"></span><span class="annot"><a href="GHC.Iface.Env.html#newIfaceNames"><span class="hs-identifier hs-type">newIfaceNames</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Name.Occurrence.html#OccName"><span class="hs-identifier hs-type">OccName</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#IfL"><span class="hs-identifier hs-type">IfL</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-295"></span><span id="newIfaceNames"><span class="annot"><span class="annottext">newIfaceNames :: [OccName] -&gt; IfL [Name]
</span><a href="GHC.Iface.Env.html#newIfaceNames"><span class="hs-identifier hs-var hs-var">newIfaceNames</span></a></span></span><span> </span><span id="local-6989586621681088640"><span class="annot"><span class="annottext">[OccName]
</span><a href="#local-6989586621681088640"><span class="hs-identifier hs-var">occs</span></a></span></span><span>
</span><span id="line-296"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681088639"><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681088639"><span class="hs-identifier hs-var">uniqs</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcRnIf IfGblEnv IfLclEnv UniqSupply
forall gbl lcl. TcRnIf gbl lcl UniqSupply
</span><a href="GHC.Tc.Utils.Monad.html#newUniqueSupply"><span class="hs-identifier hs-var">newUniqueSupply</span></a></span><span>
</span><span id="line-297"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">[Name] -&gt; IfL [Name]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">Unique -&gt; OccName -&gt; SrcSpan -&gt; Name
</span><a href="GHC.Types.Name.html#mkInternalName"><span class="hs-identifier hs-var">mkInternalName</span></a></span><span> </span><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621681088637"><span class="hs-identifier hs-var">uniq</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681088636"><span class="hs-identifier hs-var">occ</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="GHC.Types.SrcLoc.html#noSrcSpan"><span class="hs-identifier hs-var">noSrcSpan</span></a></span><span>
</span><span id="line-298"></span><span>                 </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681088636"><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681088636"><span class="hs-identifier hs-var">occ</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681088637"><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621681088637"><span class="hs-identifier hs-var">uniq</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[OccName]
</span><a href="#local-6989586621681088640"><span class="hs-identifier hs-var">occs</span></a></span><span> </span><span class="annot"><span class="annottext">[OccName] -&gt; [Unique] -&gt; [(OccName, Unique)]
forall a b. [a] -&gt; [b] -&gt; [(a, b)]
</span><a href="../../base/src/GHC.List.html#zip"><span class="hs-operator hs-var">`zip`</span></a></span><span> </span><span class="annot"><span class="annottext">UniqSupply -&gt; [Unique]
</span><a href="GHC.Types.Unique.Supply.html#uniqsFromSupply"><span class="hs-identifier hs-var">uniqsFromSupply</span></a></span><span> </span><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681088639"><span class="hs-identifier hs-var">uniqs</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-299"></span></pre></body></html>